<?php

namespace App\Providers;

use Laravel\Lumen\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;

use Exception;
use Illuminate\Support\Facades\Cache;
use App\Jobs\Message\Notice\MailNewsJob;


class EventServiceProvider extends ServiceProvider
{

    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        \App\Events\ExampleEvent::class => [
            \App\Listeners\ExampleListener::class,
        ], // 例子
        \App\Events\User\UserRegisterEvent::class => [
            \App\Listeners\User\UserRegisterListener::class, // 同步监听
            \App\Listeners\User\UserRegisterAsyncListener::class, // 异步监听
        ], // 用户注册
    ];

    /**
     * Register any events for your application.
     *
     * @return void
     */
    public function boot()
    {
        parent::boot();

        // 订阅账户提现状态变更, 发送消息通知
        // Event::listen('account.cashOutStatus', function ($data) {

        //     app('log')->info('订阅一个账户提现状态变更---' . json_encode($data));
        // });
    }
}
